﻿using System;
using System.Collections.Generic; 
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class view_scheme : System.Web.UI.Page
{
    protected int lotteryid = ReadRequest.RequestInt("lotteryid");
    protected Model.LotteryChipped model = null;
    protected string modelLotteyNo = "";
    protected Model.LotteryAnnouncement lotteryAmm = null;
    protected string ballList = null;
    protected decimal winMoney = 0;
    protected string  winCount = "未中奖";
    protected void Page_Load(object sender, EventArgs e)
    {
        model = BLL.LotteryChipped.GetModel(lotteryid);
        if (model != null)
        {
            modelLotteyNo = model.LotteryNo;
        }
        lotteryAmm = BLL.LotteryAnnouncement.GetModelBySql("SELECT * FROM LotteryAnnouncement where LotteryQS='" + model .LotteryOpenTime+ "' and LotteryType=" + model.LotteryType);

        if (lotteryAmm != null)
        {
            ballList = lotteryAmm.LotteryNo;
            winMoney = lotteryAmm.oneMoney + lotteryAmm.twoMoney + lotteryAmm.threeMoney + lotteryAmm.fourMoney + lotteryAmm.fiveMoney + lotteryAmm.sixMoney;
            if (lotteryAmm.oneCount > 0)
            {
                winCount = "一等奖 <font>" + lotteryAmm.oneCount + "</font> 注,";
            }
            if (lotteryAmm.twoCount > 0)
            {
                winCount += "二等奖 <font>" + lotteryAmm.twoCount + "</font> 注,";
            }
            if (lotteryAmm.threeCount > 0)
            {
                winCount += "三等奖 <font>" + lotteryAmm.threeCount + "</font> 注,";
            }
            if (lotteryAmm.fourCount > 0)
            {
                winCount += "四等奖 <font>" + lotteryAmm.fourCount + "</font> 注,";
            }
            if (lotteryAmm.fiveCount > 0)
            {
                winCount += "五等奖 <font>" + lotteryAmm.fiveCount + "</font> 注,";
            }
            if (lotteryAmm.sixCount > 0)
            {
                winCount += "六等奖 <font>" + lotteryAmm.sixCount + "</font> 注,";
            } 
        }
    }
    public string select(object userid)
    {
        Model.CMember cm = null;
        cm = BLL.CMember.GetModel(long.Parse(userid.ToString()));
        return cm != null ? cm.nickname : "暂无姓名";
    }
}